#include "Thread.hpp"
#include <pthread.h>
#include <unistd.h>
using namespace ThreadModule;
int main() {
    Thread t([]() {
        while(true) {
            char name[256];
            pthread_getname_np(pthread_self(), name, sizeof(name));
            cout << "我是一个新线程：" << name << endl;
            sleep(1);
        }
    });
    t.Start();
    t.Detach();
    sleep(5);
    t.Stop();
    sleep(5);
    // t.Join();
    // sleep(5);
    return 0;
}